/**
 * Main.java
 * Version: 1.0
 * Created in 06/08/2013
 * Created by: Gerson Groth
 * 
 * Copyright
 */
package webcrawler.activities;

import javax.swing.UIManager;

import org.apache.log4j.Logger;

import webcrawler.activities.data.DataFile;
import webcrawler.activities.data.DataManager;
import webcrawler.activities.view.MainFrame;

/**
 * The Class Main.
 *
 * @author Gerson Groth
 */
public class Main {

	/** The logger. */
	private Logger logger = Logger.getLogger(Main.class);
	
	/** The instance. */
	public static Main INSTANCE;

	/**
	 * The main method.
	 *
	 * @param args the arguments
	 */
	public static void main(String[] args) {
		INSTANCE = new Main();
		INSTANCE.start();

	}

	/**
	 * Start.
	 */
	private void start() {
		try {
			// Set System L&F
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (Exception e) {
			logger.error("Error defining look and feel: " + e.getMessage());
		}

		DataManager.getINSTANCE().loadData();
		

		MainFrame frame = new MainFrame();
		frame.setVisible(true);
	}

	/**
	 * Gets the single instance of Main.
	 *
	 * @return single instance of Main
	 */
	public static Main getInstance() {
		return INSTANCE;
	}

}
